package com.example.prove;

import android.app.Activity;
import android.content.Context;
import android.view.View;
import android.widget.TextView;

import com.molinari.androidstructure.widget.arrayAdapter.ArrayAdapterCustom;

public class Lista extends ArrayAdapterCustom<Notizia> {

	public Lista(Context context, Activity activity, int resource, Notizia[] notizias) {
		super(context, activity, resource, notizias);
	}

	private static class RowMomento {
		public TextView userText;
		public TextView passText;
	}

	@Override
	public Object initViewMemento(View convertView) {
		RowMomento rowMomento = new RowMomento();
		rowMomento.userText = (TextView) convertView.findViewById(R.id.textView1);
		rowMomento.passText = (TextView) convertView.findViewById(R.id.textView2);
		return rowMomento;
	}


	@Override
	public void aggiornaViewMemento(Notizia item, Object viewMemento,
			int position) {
		RowMomento rowMomento = (RowMomento) viewMemento;
		rowMomento.userText.setText(item.getTitolo());
		rowMomento.passText.setText(item.getDescrizione());
		
	}
}
